import common
import DCOracle2
import unittest

class test_raw(common.TestCase):

    tables_to_drop = ('test',)
    
    def test_raw(self):

        lump = self._getBinary(200)
        
        c = self.c

        c.execute('create table test (name varchar2(64), id number(9), photo long raw)')

        c.execute("insert into test (name, id, photo) values (:1, :2, :3)", \
                  "Shane Hathaway", 4, DCOracle2.Binary(lump))


        c.execute("select photo from test where id > 3")

        self.assertEqual(c.fetchone()[0],
                         lump,
                         'selected binary data different from inserted binary data')

        self.db.rollback()

if __name__ == '__main__':
    unittest.main()
